var timer = {
  _timer: null,
  init: function () {
    var _this = this
    this.time = 60
    _this.render()
    _this.start()
  },
  render: function () {
    var msg = '试看将在<span style="color: yellow;font-size: 24px;"> ' + this.time + ' </span>秒后结束，订购可观看完整节目！'
    var style = 'color: #fff; font-size: 20px;position:absolute; z-index: 10000; left: 0; right: 0; top: 0; height: 50px; line-height: 50px; text-align:center;background:url(./images/mark_bg.png) repeat;'
    if ($('#time-clock').length) {
      $('#time-clock').html(msg)
    } else {
      $('body').append('<div style="' + style + '" id="time-clock">' + msg + '</div>')
    }
  },
  start: function () {
    var _this = this
    clearInterval(_this._timer)
    _this._timer = setInterval(function () {
      _this.time--
      if (_this.time > 0) {
        _this.render()
      } else {
        clearInterval(_this._timer)
        // 跳订购
        utils.order()
      }
    }, 1000)
  }
}